// SETUP

#include intrographics.txt
#include ladyluckbiggraphics.txt

setdatapath("data/graphics/cutscenes/jester/");

var jestergraphics = {
	idle: {
		animation: "jester_idle.json",
		pack: "jester.pck",
		loop: true
	},
	defiant_idle: {
		animation: "jester_defiant_idle.json",
		pack: "jester.pck",
		loop: true
	}
}
var jester = addsprite("jester", 1, jestergraphics);

// HELPER FUNCTIONS	

var fade_time = 0.4;

// ACTORS
actor("Lady Luck", screenwidthmid + 800, 550, Col.YELLOW, CENTER, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
actor("Jester", 2600, 600, Col.multiplylightness(Col.RED, 1.25), RIGHT, TOP, "chat_jester", "characters/jester/charicon_jester");

// INTRO

play("music_cutscene_dark");

jester.scale = 0.5;
jester.x = 2600 - ((jester.getwidth("idle") * jester.scale) / 2);
jester.y = 670;
changebackground("intro_stage");
fadein();
jester.show("idle");

ladyluck_big.x = -screenwidth;
ladyluck_big.show("idle-confused");
Actuate.tween(ladyluck_big, 2, { x: 0 }).ease(Expo.easeOut);

wait(0.5);

ladyluck_big.show("talking-confused", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "Well, let’s all fall silent for the Jester once again.");
speak("Lady Luck", "And let's ignore how pleased with themselves they look.");
ladyluck_big.show("idle-confused", true);

actor("Jester", 2600, 670, Col.multiplylightness(Col.RED, 1.25), CENTER, BOTTOM, "chat_jester", "characters/jester/charicon_jester");
speak("Jester", "I’m a jester. I’m always pleased with myself.");

actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
ladyluck_big.show("talking-sly", true);
speak("Lady Luck", "I’d expect you of all people to know|how likely it is that you’ll fail...");
speak("Lady Luck", "...how improbable it is that you and your new|pals can thwart fate and chance and entropy.");
ladyluck_big.show("idle-sly", true);

speak("Jester", "Still, better to try anyway, right?");
speak("Jester", "And if it doesn’t work this|time, we'll try again.");
speak("Jester", "And again. And again.");
speak("Jester", "Until it does.");

ladyluck_big.show("talking-confused", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "Yes, people say the same thing about the lottery, I believe.");
speak("Lady Luck", "You should really know better, after all this time.");
ladyluck_big.show("talking-sly", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "But I suppose you don’t have any other options.");
speak("Lady Luck", "So, in you go!");
ladyluck_big.show("idle-sly", true);

startgamefromcutscene();